package com.dtsheep.rxjava.stduy.observable;

import rx.Observable;
import rx.Subscription;

/**
 * JustDemo
 *
 * <p>
 *     just 操作符创建多个 Observable
 * </p>
 *
 * @author chuanbai
 * @date 2024/5/17
 */
public class JustDemo {

    /**
     * 创建多个 被观察对象
     *
     * @param
     * @return
     * @author chuanbai
     * @date ${DATE}
     */
    public void Just1(){

        // 创建 observable 对象
        Observable<String> observable = Observable.just("111", "222");

        // 订阅
        Subscription subscription = observable.subscribe(obj -> {
            System.out.println(obj);
        });

    }

    public static void main(String[] args) {
        JustDemo justDemo = new JustDemo();
        justDemo.Just1();
    }
}
